package org.qiuer.func.function.array;

import org.qiuer.func.AMemberFunction;
import org.qiuer.run.Context;

import java.util.List;

/**
 * list.push(element)
 */
public class ArrayPushFunction extends AMemberFunction<List> {

  @Override
  public String getName() {
    return "push";
  }

  @Override
  public Object run(List member, Context context, Object... args) {
    member.add(args[0]);
    return null;
  }
}
